package com.kzd.gtgame.main.home.adapter

import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.kzd.gtgame.R
import com.kzd.gtgame.entity.SearchDefault
import com.kzd.gtgame.main.game.adapter.Game7Adapter


/**
 * 搜索-热搜-记录关键词适配器
 * */
class HomeSearchLabelAdapter :
    BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_search_label) {
    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.tvSearchLabelName, item)
    }
}

class HomeSearchGuessAdapter :
    BaseQuickAdapter<SearchDefault, BaseViewHolder>(R.layout.item_search_guess) {
    override fun convert(holder: BaseViewHolder, item: SearchDefault) {
        holder.setText(R.id.tvSearchGuessTable, item.name)
        holder.getView<RecyclerView>(R.id.rvSearchGuessBody)
            .adapter = Game7Adapter().apply {
            setNewInstance(item.list)
        }
    }
}